https://msiter.ru/references/html5-canvas/ispointinpath
Javascript метод isPointInPath()